<?php
namespace app\index\controller;

use app\BaseController;
use app\common\model\SystemUser;
use think\facade\Db;
use app\common\model\Goods;
use app\common\model\Brand;

class Index extends BaseController
{
	
    public function index()
    {
        $arr = [
            "name" => "测试",
            "jian" => 20
        ];
        return "hellofuchao";

//        $content = "&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;测试052205&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;ssss&lt;/b&gt;&lt;/p&gt;";
//        var_dump(htmlspecialchars_decode($content));die;

        //$res = Db::name('ztest')->save(['content'=>'测试一下税局']);
        //var_dump($res);die;

//        $goodsModel = Goods::find(1);
//        //var_dump($goodsModel);die;
//
//        var_dump($goodsModel->state);die;

//    	$res = Db::name('banner')->select()->toArray();
//    	var_dump($res);die;

        //$res = Goods::goodsTails(1);
        //$res = (new Brand)->brandGoods(1);

        //$res = SystemUser::getUserRoleList();

        //dump($res);die;
        //return json($res);
    }

//    public function read($id)
//    {
//        return download('image.jpg', 'my.jpg');
//    }

    public function download()
    {
        //var_dump(app('http')->getName());die;       // 获取当前应用名

        // download是系统封装的一个助手函数
        //$data = '这是一个测试文件';
        //return download($data, 'test.txt', true);

        return download(root_path().'\public\static\image.jpg','my.jpg');

        //return download('https://image.huanhuanhuishou.com/503024d7f466d5c468be1ddbab32bf7f.png','my.jpg');

    }

    
}
